package sch.frog.structural.composite;

import java.util.ArrayList;
import java.util.List;

public class ObjectA {

    List<ObjectA> children = new ArrayList<ObjectA>();

    public List<ObjectA> getChildren() {
        return children;
    }

    public void setChildren(List<ObjectA> children) {
        if(children != null) this.children = children;
    }

    public void addChildren(ObjectA obj){
        children.add(obj);
    }

    public void removeChildren(ObjectA obj){
        children.remove(obj);
    }

    public void show(){
        for(ObjectA objA : children){
            System.out.println(objA);
        }
    }
}
